package com.tjc.exception;

import com.tjc.model.ErrorCode;

/**
 * @ClassName BusinessException
 * @Author tjc
 **/
public class BusinessException extends RuntimeException {
    private ErrorCode errorCode;
    private int code;

    public BusinessException(String message, ErrorCode errorCode) {
        super(message);
        this.errorCode = errorCode;
    }

    public BusinessException(String message, int code) {
        super(message);
        this.code = code;
    }

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMsg());
        this.errorCode = errorCode;
    }
}
